Currently, a digital camera has been widely used as a device that captures a digital image. A user causes an object, which is desired to be photographed, to be automatically or manually focused on and performs a photographing operation to thereby acquire an image of the object. The object that is focused on is clearly photographed and an object that is not focused on is photographed with blur. A degree of blur is determined by an image capturing device and is able to be adjusted by the user by changing an aperture. However, in a camera module installed in a smartphone or the like, a compact digital camera, or the like, it is difficult to adjust the aperture or the depth of field is deep, so that an amount of blur desired by the user is not obtained in some cases.
Thus, a technique by which an image with a greater degree of blur than that of a captured image is obtained by blurring a background of a main object through image processing has been developed. For example, the technique includes, continuously capturing a plurality of images with different focus positions, determining in-focus degrees of objects to estimate distances, and averaging the focus positions of objects away from an in-focus main object, and by using the technique, an image whose background is blurred is generated.
On the other hand, since gamma correction processing has been performed for the captured images and relation between a captured image and brightness is nonlinear, when the captured images are simply averaged, the resulting blurred image comes to have brightness different from that of the actual blurred image captured by blurring an actual object. In a case where an object is bright, since gradation values of the captured images may be saturated, when the captured images are simply averaged, the resulting blurred image comes to have brightness different from that of the actual blurred image captured by blurring an actual object.
Thus, as a method of performing blurring processing with high quality, a technique of performing averaging processing after converting a gradation value of a captured image has been proposed, for example, in PTL 1. In PTL 1, when a value of background image data in each of pixels is high, conversion of amplifying the background image data in the pixel is performed and blurring processing is performed, and then, conversion inverse to the aforementioned conversion is performed. Thereby, blurring processing in which brightness of a high gradation part is enhanced is realized.